Channel: Automation Step by Step
Category: Education
Tags: gatling beginners tutorialgatling feeders demogatling csv filesgatling online traininggatling how to use csv filegatling how to refer data from filegatling data driven testing
Description: Gatling Quiz - automationstepbystep.com/quiz-time 00:00 Introduction 00:24 What are Feeders 00:48 How to use Feeders 01:59 Create simulation script 03:23 Declare feeder in script with feeder strategy 04:18 Feeder Strategies explained 05:43 Add feed step in scenario .feed(feeder) 14:33 How to refer any data from csv file 23:00 Important Notes Notes: What are Feeders Data sources like csv, json files to store test data How to use Feeders Step 1 - Create a test data file (csv) and add data as needed for the test Step 2 - Declare feeder in script with feeder strategy Java example: FeederBuilder.Batchable<String> feeder = csv("search.csv").random(); Scala example: val feeder = csv("search.csv").random Kotlin example: val feeder = csv("search.csv").random() Feeder Strategies: queue - default takes value in a queue (sequentially) will throw error if it runs out of lines shuffle works like queue, but values are chosen randomly will throw error if it runs out of lines random chooses values randomly same values can be chosen several times will NOT throw error on end of line circular takes the values as in the feeder in order on reaching last value, returns to the first value Step 3 - Add feed step in scenario .feed(feeder) Step 4 - To refer any data from csv file use syntax #{columnName} .feed(feeder) .exec(http("Search") .get("/computers?f=#{columnName}") Note: Every time we use the function feed(feeder) it gets next row from csv If the strategy is random or circular, the rows will get recycled and No Error will be thrown Can increase users to use multiple sets of data from csv Can use repeat() function #GatlingBeginnerTutorials All FREE courses - automationstepbystep.com Stories by Raghav - automationstepbystep.com/stories _________________________________________________________ Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you You can support my mission for education by sharing this knowledge and helping as many people as you can If my work has helped you, consider helping any animal near you, in any way you can. Never Stop Learning Raghav